import React from 'react';
import { createRoot } from 'react-dom/client';
import App from './App';

// 确保DOM加载完成后再渲染
document.addEventListener('DOMContentLoaded', () => {
  const container = document.getElementById('root');
  if (!container) {
    console.error('找不到root元素');
    return;
  }

  const root = createRoot(container);
  root.render(
    <React.StrictMode>
      <App />
    </React.StrictMode>
  );

  // 用于调试
  console.log('React应用已开始渲染');
});



